import request from '@/plugins/axios/request';
const baseURL = process.env.VUE_APP_BASE_API;

// [代码接口]下拉框
export function select(params) {
  return request({
    url:  `${baseURL}/tech-dict/select`,
    method: "get",
    params,
  });
}

// [项目接口]项目下拉框
export function projectSelect() {
  return request({
    url: `${baseURL}/tech-project/select`,
    method: "get",
  });
}
// [项目接口]项目下拉框（用于管理端）
export function projectSelectManage() {
  return request({
    url: `${baseURL}/tech-project/selectGuanLi`,
    method: "get",
  });
}

// [项目接口]项目下拉框（科研端）
export function projectSelectScience() {
  return request({
    url: `${baseURL}/tech-project/selectKeYan`,
    method: "get",
  });
}
//[成果管理]列表
export function achievementList(data) {
  return request({
    url: `${baseURL}/tech-achievement/projectList`,
    method: "post",
    data,
  });
}

//[成果管理]成果细节
export function achievementDetail(params) {
  return request({
    url: `${baseURL}/tech-achievement/detail/${params.achievementId}`,
    method: "get",
    // params,
  });
}

//[成果管理]成果删除
export function delAchievement(achievementIds) {
  return request({
    url: `${baseURL}/tech-achievement/batchDelete`,
    method: "post",
    data: {
      ids:achievementIds,
    },
    isShowMessage:true
  });
}

//[成果管理]科技成果报表
export function achievementGetWord(data) {
  return request({
    url: `${baseURL}/tech-achievement/getWord`,
    method: 'post',
    data: data,
    isDownLoadFile:true
  })
}

//[成果管理]成果导出
export function achievementExport(data) {
  return request({
    url: `${baseURL}/tech-achievement/export`,
    method: 'post',
    data: data,
    isDownLoadFile:true
  })
}

//[成果管理]成果导入
export function achievementImport(data) {
  return request({
    url: `${baseURL}/tech-achievement/import`,
    method: "post",
    data,
  });
}

// [成果管理]成果下载模板
export function downTemplate(data) {
  return request({
    url: `${baseURL}/tech-achievement/downloadTemplate`,
    method: 'post',
    data: data,
    isDownLoadFile:true
  })
}

//[成果管理]成果登记
export function achievementSubmit(data) {
  return request({
    url: `${baseURL}/tech-achievement/submit`,
    method: "post",
    data,
  });
}

//[成果管理]成果登记（管理端）
export function achievementSubmitManage(data) {
  return request({
    url: `${baseURL}/tech-achievement/submitGuanLi`,
    method: "post",
    data,
  });
}


//[成果管理]成果编辑
export function achievementEdit(data) {
  return request({
    url: `${baseURL}/tech-achievement/edit`,
    method: "post",
    data,
  });
}

//[成果管理]成果上报
export function achievementReport(achievementIds) {
  return request({
    url: `${baseURL}/tech-achievement/report`,
    method: "post",
    data: {
      ids:achievementIds,
    },
    isShowMessage:true
  });
}

// [成果接口]成果统计分析
export function techAchievementShow(data) {
  return request({
    url: `${baseURL}/tech-achievement/show`,
    method: 'post',
    data: data
  })
}
